#ifndef TRANSFORM_COMPONENT_H
#define TRANSFORM_COMPONENT_H

#include "Maths/Matrix.h"
#include "Maths/Quaternion.h"
#include "Maths/Vec3.h"

class TransformComponent
{
public:
	TransformComponent(void);
	~TransformComponent(void);

	inline void SetPosition(const Vec3& aVec) {mPos = aVec; mDirty = true;}
	inline void SetScale(const Vec3& aVec) {mScale = aVec; mDirty = true;}
	inline void SetRotation(const Quaternion& aQuat) {mRot = aQuat; mDirty = true;}

	inline Vec3& GetPosition(){	return mPos;}
	inline Vec3& GetScale( ) {	return mScale;}
	inline Quaternion& GetRotation( ) {return mRot; }
	inline const Vec3 GetPosition()const {	return mPos;}
	inline const Vec3 GetScale( ) const  {	return mScale;}
	inline const Quaternion GetRotation()const {return mRot; }

	const Matrix& GetConstMatrixTransform () ;
	Matrix GetMatrixTransformForRender () ;
	Matrix GetCopyMatrixTransform () ;

	inline void Move(const Vec3& aVec) {mPos += aVec; mDirty = true;}
	inline void Move(const float aX,const float aY, const float aZ) {mPos.SelfTranslate(aX,aY,aZ); mDirty = true;}
	inline void Rotate(const Quaternion& aQuad) { mRot.SelfMult(aQuad); mDirty = true;}

private:
	Vec3 mPos;
	Vec3 mScale;
	Quaternion mRot;
	Matrix mTransformMat;

	bool mDirty;
};


#endif // ifndef TRANSFORMCOMPONENT